<div class="post">
    <div class="entry">
        <div class="test">
            <?php   $session_data_sm = $this->session->userdata('logged_in_te');
                    $test_id=$session_data_sm['test_sub_title'].".csv";
                    foreach($query_ques2 as $rows_ques){
                    $id=$rows_ques->id_question;
                    $id_back=$rows_ques->id_question-1;
                    $id_next=$rows_ques->id_question+1;
                    $sql="SELECT * FROM qsubmit where id_question='$id' and id_te='$id_te' and test_id='$test_id'";
                    $query20=$this->db->query($sql);
                    ?>
            <div id="q_question">
                <h3><?=$rows_ques->id_question?>></h3><h2>&nbsp<?=$rows_ques->qw?></h2>
            </div>
            </br>
            <div id="q_answer">
                <?php if($id==$max_ques)
                            {?>
                            <form action="<?php echo base_url().'tester/submit_f2/'.$id?>" method="post" onclick="submit">
                            <?php }
                            else
                            {?>
                <form action="<?php echo base_url().'tester/sub_ques_f2/'.$id_next;?>" method="post" onclick="next">
                            <?php }?>
                <table>
                    <tr>
                        <input type="hidden" name="txtID" value="<?=$id_next-1?>">
                    </tr>
                    
                    <tr>
                        <td><textarea name="text3" cols="60" rows="5"><?php foreach($query20->result() as $rows20)
                    {if(isset($rows20->sub_an)) echo $rows20->sub_an;}?></textarea></td>
                    </tr>
                   
                    <tr>
                        <td align="left">
                            <?php 
                            if($rows_ques->id_question>1)
                            {
                            $titleBack = '<img src ="'.base_url().'public/frontend/images/back.jpg" width=70 height=50 />';
                            $back = anchor("tester/back_ques_f2/$id_back",$titleBack);
                            echo $back;
                            }
                            ?>
                            
                        </td>
                        <td align="right">
                            <?php if($id==$max_ques)
                            {?>
                                <input type="image" name="submit" src="<?php echo base_url();?>public/frontend/images/submit.png" width="70" height="50"    >
                            <?php }
                            else
                            {
                            ?>
                            <input type="image" name="next" src="<?php echo base_url();?>public/frontend/images/next.jpg" width="70" height="50"    >
                            <?php }?>
                        </td>
                    </tr>
                </table>
                </form>
            </div>
            <div>
                
            </div>
            <?php }?>
        </div>
    </div>
</div>

